$(document).ready(function(){							   
$("#scroll_wrap").css({"overflow":"hidden"});
$("#scroll_wrap").bind("mousewheel", function(event, delta) {
	var speed = 20;
	var mySlider = $("#scroll_line");
	var sliderVal = mySlider.slider("option", "value");
	sliderVal -= (delta*speed);
	
	if (sliderVal > mySlider.slider("option", "max")) sliderVal = mySlider.slider("option", "max");
	else if (sliderVal < mySlider.slider("option", "min")) sliderVal = mySlider.slider("option", "min");
	
	$("#scroll_line").slider("value", sliderVal);
	
	event.preventDefault();
});
	$("#scroll_line").slider({
		animate: false,
		change: handleSliderChange,
        slide: handleSliderSlide,
		max:500
	});
});

function handleSliderChange(e, ui)
{
  var maxScroll = $("#scroll_wrap").attr("scrollWidth") - $("#scroll_wrap").width();
  $("#scroll_wrap").attr({scrollLeft: ui.value * (maxScroll / 500)});
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $("#scroll_wrap").attr("scrollWidth") - $("#scroll_wrap").width();
  $("#scroll_wrap").attr({scrollLeft: ui.value * (maxScroll / 500)});
}